<extend name="Public/base" />
<block name="content">
<div id="content">
	<div id="content-header">
		<div id="breadcrumb">
			<a href="{:U('Index/index')}" title="首页" class="tip-bottom"><i class="icon-home"></i> 首页</a> <a href="{:U('/Article/article')}" class="current">{$meta_title}</a><present name="data_up"><a href="{:U('/Article/article/pid/'.$data_up['ask_article_id'])}">[ {$data_up.ask_article_name} ] </a></present><a><present name="data">[ {$data.ask_article_name} ]</present></a>
		</div>
	</div>
	<div class="container-fluid">
		<br>
		<a class="btn btn-info" href="{:U('addArticle')}">新增</a>
		<button class="btn btn-warning ajax-post" url="{:U('Article/changeArticle?method=resume')}" target-form="ids">启用</button>
		<button class="btn btn-success ajax-post" url="{:U('Article/changeArticle?method=forbid')}" target-form="ids">禁用</button>
		<button class="confirm btn btn-danger ajax-post" url="{:U('Article/changeArticle?method=delete')}" target-form="ids">删除</button>
	</div>
	<div class="container-fluid search-form">
		<form class="m-filter" autocomplete="off">
			<div class="clearfix">
				<a class="pull-left btn btn-success btn-filter-show" id="j-filter-show"><span class="icon-chevron-down"></span></a>
			</div>
			
			<div class="filter-box" id="j-filter-box">
				<!-- 基础信息 -->
				<div class="filter-base filter-group">
					<a class="title"><span class="icon-list"></span> 分类筛选</a>
					<span class="control-group">
						<select class="form-control" style="width: 150px;" name="ask_category_pid" id="ask_category_pid" onchange="change_ask_category(this.value,'{:U('ServiceApi/getAskCategory')}',1)">
							<option value=0>选择一级分类</option>
							<volist name="category_list" id="vo">
								<option value='{$vo.ask_category_id}'>{$vo.ask_category_name|strip_tags}</option>
							</volist>
						</select>
					</span>
					<span class="control-group">
						<select class="form-control" style="width: 150px;" name="ask_category_id" id="ask_category_id">
							<option value=0>选择二级分类</option>
							<volist name="two_category_list" id="vo">
								<option value='{$vo.ask_category_id}'>{$vo.ask_category_name|strip_tags}</option>
							</volist>
						</select>
					</span>
				</div>
				<div class="filter-base filter-group">
					<a class="title"><span class="icon-list"></span> 位置筛选</a>
						<span class="control-group">
							<select class="form-control" style="width: 150px;" name="position" id="position">
								<option value='-1'>选择位置</option>
								<volist name=":C('ASK_ARTICLE_POSITION')" id="vo">
									<option value='{$key}'>{$vo}</option>
								</volist>
							</select>
						</span>
				</div>
				<!-- /基础信息 -->
				
				<div class="filter-input filter-group clearfix">
					<a class="title"><span class="icon-globe"></span> 文章标题</a>
				  	<div class="control-group pull-left">
				    	<div class="controls">
				    		<input type="text" name="search_text" class="search-input" value="{:htmlspecialchars(I('search_text'))}" placeholder="请输入标题" style="margin-bottom:0;">
				    	</div>
				  	</div>
				</div>
			
				<div class="clearfix btn-group">
					<a class="btn btn-success btn pull-left" id="j-filter-hide" style="margin-left:15px;"><span class="icon-chevron-up"></span></a>
					<button type="button" id="search_button" url="{:U('Article/article')}" class="btn btn-primary btn pull-left"><span class="icon-search"></span></button>
				</div>	
			</div>		
		</form>
	</div>
	<div class="container-fluid">	
		<div class="row-fluid">
			<div class="span12">
				<div class="widget-box">
					<div class="widget-content ">
						<form id="export-form" method="post" action="">
							<table id="config_table" class="table table-bordered table-striped with-check">
								<thead>
									<tr>
										<th width="5%"  class="row-selected">
				                            <input class="checkbox check-all" type="checkbox">
				                        </th>
				                        <th width="5%" class="taskStatus">ID</th>
				                        <th width="30%" class="taskStatus">文章标题</th>
				                        <th width="15%" class="taskStatus">创建时间</th>
				                        <th width="15%" class="taskStatus">编辑时间</th>
				                        <th width="10%" class="taskStatus">排序</th>
				                        <th width="10%" class="taskStatus">状态</th>
				                        <th width="15%" class="taskStatus">操作</th>
									</tr>
								</thead>
								<tbody>
									<notempty name="_list">
						                <volist name="_list" id="menu">
						                    <tr>
						                        <td><input class="ids row-selected" type="checkbox" name="id[]" value="{$menu.ask_article_id}" class="ids" /></td>
						                        <td class="taskStatus">{$i}</td>
						                        <td class="taskStatus">
						                            {$menu.ask_article_title|htmlspecialchars|msubstr=###,0,20}
						                        </td>
						                        <td class="taskStatus">{$menu.create_time|time_format="Y-m-d H:i:s"}</td>
						                        <td class="taskStatus">{$menu.update_time|time_format="Y-m-d H:i:s"}</td>
						                        <td class="taskStatus">{$menu.sort}</td>
						                        <td class="taskStatus">
						                        	<if condition="$menu['status'] eq 1">启用<else/>已禁用</if>
						                        </td>
						                        <td class="taskStatus">
						                            <a title="编辑" href="{:U('editArticle?id='.$menu['ask_article_id'])}"><i class="icon-pencil"></i> 编辑</a> 　
						                            <a class="confirm ajax-get" title="删除" href="{:U('changeArticle',array('id'=>$menu['ask_article_id'],'method'=>'delete'))}"><i class="icon-remove"></i> 删除</a>
						                        </td>
						                    </tr>
						                </volist>
									<else/>
										<tr>
											<td colspan="10" class="taskStatus">暂时还没有内容! </td>
										</tr>
									</notempty>
								</tbody>
							</table>
							<div class="dataTables_paginate fg-buttonset ui-buttonset fg-buttonset-multi ui-buttonset-multi paging_full_numbers" id="DataTables_Table_0_paginate">
								{$_page}
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
$(function (){
	set_value("ask_category_pid",'{:(int)I('get.ask_category_pid')}');
	set_value("ask_category_id",'{:(int)I('get.ask_category_id')}');
	set_value("position",'{:(int)I('get.position')}');
	});
//条件框
$("#j-filter-hide").click(function(){
	$("#j-filter-box").fadeOut(300);
	$("#j-filter-show").fadeIn(300);
});
$("#j-filter-show").click(function(){
	$("#j-filter-box").fadeIn(300);
	$(this).fadeOut(300);
});
highlight_subnav("{:U('Article/article')}");//导航高亮
</script>
</block>


